<form method="POST" name="form_admin" action="<?php echo formEditAction()?>" onsubmit="return CheckForm(this)">
<input type="hidden" name="id" value="<?echo $id?>" />
<table width="100%" cellpadding="0" cellspacing="0" id="tbledit">
    <tr>
		<td height="10"></td>
	</tr>
	
	<tr>
        <td width="150"><b><span class="style1"><?echo _URL?></span></b></td>
        <td><input class="normal3" type="text" name="URL" id="URL" value="<?php echo $content["cUrlString"]; ?>" />
			<span id="div_url" style="color:#FF0000"></span></td>
    </tr>
	
	<tr>
      <td><span class="style1"><b><?echo _NAME?></b></span></td>
	  <td>	
	  	<input class="normal3" type="text" name="Name" id="Name" value="<?php echo $content["cName"]?>" />      
	  </td>
    </tr>
	
	<tr>
      <td><span class="style1">Product Code</span></td>
	  <td>
	  	<input type="text" name="Code" id="Code" class="normal0" value="<?echo $content['cCode']?>" />      
	  </td>
    </tr>	
	
	<?
	if($hasTag)
	{
	?>
	<tr>
      <td><b><?echo _TAGS?></b></td >
	  <td><input type="text" id="Tag" name="Tag" value="<?php echo $content["cTag"]?>" /></td>
    </tr>
	<?
	}
	?>
	
	<tr>
      <td><b>Category</b></td>
	  <td>
	  	<select name="Category" id="Category" style="width:200px">
          <?echo ListOptionParentProduct($content["iParentId"],-1)?>
        </select>     
		</td>
    </tr>	
	
	<tr>
      <td><b><?echo _TRADE?></b></td>
	  <td>
	  	<select name="Trade" id="Trade"  style="width:200px">
          	<?php echo ListOptionTrade($content['iTradeId'])?>
        </select>      </td>
    </tr>
	
	<tr>
      <td><b><?echo _WARRANTY?></b></td>
	  <td>
	  		<input type="text" class="shright" name="Warranty" value="<?echo $content['cWarranty']?>" /> <?echo _MONTH?>
	  </td>
    </tr>
	
	<tr>
      <td><b><?echo _PROMOTION?></b></td>
	  <td>
	  		<input type="text" class="shright" name="Promotion" value="<?echo $content['cPromotion']?>"  /> (Option)
	  </td>
    </tr>
	
	<tr>
      <td><b><?echo _DEPOSITORY?></b></td>
	  <td>
	  		<input type="text" class="shright" name="Depository" value="<?echo $content['cDepository']?>"  /> (0 = Sold Out)
	  </td>
    </tr>
	
	<tr>
      <td><b><?echo _PRICE?></b></td>
	  <td>
	  		<input type="text" class="shright" name="Price" value="<?echo $content['cPrice']?>"  /> <?echo getconfig("UnitInput")?>
	  </td>
    </tr>
	
	<tr>
      <td><b><?echo _PRICEOLD?></b></td>
	  <td>
	  		<input type="text" class="shright" name="PriceOld" value="<?echo $content['cPriceOld']?>"  /> <?echo getconfig("UnitInput")?>
	  </td>
    </tr> 
	
	<tr>
      <td><b><?echo _INTROIMAGE?></b></td>
	  <td>
	  	<?php echo inputFile('ImgIntro',$content["cImage"])?>
		</td>
    </tr>
	
	 <?php
	if(HAS_BANNER==true)
	{
	?>
    <tr>
        <td><b><?php echo _BANNERIMAGE?></b></td>
      <td>
            <?php echo inputFile('ImgBanner',$content["cBanner"],'banner')?>
		</td>
    </tr>
    <?php
	}
	?>
    
    <?php
	if(HAS_BACKGROUND==true)
	{
	?>
    <tr>
        <td><b>Background Image</b></td>
        <td>
            <?php echo inputFile('ImgBackground',$content["cBackground"],'background')?>
        </td>
    </tr>
    <?php
	}
	?>
	
	<tr>
      <td valign="top"><b>Status</b></td>
	  <td>		
        <select name="Status" id="Status">
          <?php echo liststatus($content["iStatus"]) ?>
        </select>
      </td>
    </tr>
	
     <tr>
        <td valign="top" style="vertical-align:top"><b>Short Description</b></td>
        <td style="padding-bottom:10">
		<textarea style="height:100px; width:90%;" name="Description"><?php echo $content["cDescription"]?></textarea></td>
    </tr>
	
     <tr>
        <td valign="top" style="vertical-align:top">
			<b>Detail description</b>
			<div>[ <a style="cursor:pointer" onclick="addTablePr('Content')">Add Table Property</a>] </div>
		</td>
        <td><textarea style="height:300px; width:90%;" name="Content" class="tinymce"
				id="Content"><?php echo $content["cContent"]; ?></textarea></td>
    </tr>
	
	
<?/*	
	<tr>
		<td colspan="2">
		
		<fieldset>
		<legend>Propertyies</legend>
		<?
		if(count($properties)==0)
		{
			echo "<div style='color:#ff0000'><strong>Not found Properties. <a href='?opt=property&id=$idP'>Please Click here to add Property</a></strong></div>";
		}
		?>
		<table width="100%" cellpadding="0" cellspacing="0">		
		<?
		foreach($properties as $i => $field)
		{
		?>
			
			<tr>
			  <td width="150" class="pl10"><b title="<?echo $field['description']?>" ><?echo $field['name']?></b></td>
			  <td>
					<input type="text" class="normal3" style="width:50%" title="<?echo $field['description']?>" 
					name="property_<?echo $field['id']?>" value="<?echo $field['value']?>" />
			  </td>
			</tr> 
		<?
		}
		?>		
		</table>
		</fieldset>
		</td>
	</tr>
*/?>


	<tr>
		<td><b>Filters</b></td>
		<td  style="padding-bottom:5px">		
		<table>
		<tr>
		<?
		$u=1;
        if(!is_array($filters))
        {
            $filters    = array();
        }
		foreach($filters as $i => $filter)
		{
			if($filter['cValue']=="Price")continue;
		?>
			<td><strong><?echo $filter['cName']?></strong></td>
			<td style="padding-right:15px">
				<select name="filters[]" style="width:180px">
					<?echo ListOptionFilterValue($filter['iId'],$id)?>
				</select>
			</td>
		<?
		if($u%4==0 && $u>1)echo '</tr><tr>';
		$u++;
		}
		?>
		</tr>
		</table>
		</td>
	</tr>
	
	<tr>
		<td><b><?echo _METATITLE?></b></td>
		<td>
			<input class="normal3" style="width:90%" type="text" name="MetaTitle" id="MetaTitle" value="<?php echo $content["cMetaTitle"]; ?>" />        </td>
	</tr>
	
	<tr>
		<td><b><?echo _METAKEYWORDS?></b></td>
		<td>
			<input class="normal3" style="width:90%" type="text" name="MetaKeywords" id="MetaKeywords" 
			value="<?php echo $content["cMetaKeywords"]; ?>" />        
		</td>
	</tr>
	
	<tr>
		<td><b><?echo _METADESCRIPTIONS?></b></td >
		<td style="padding-bottom:10">
		<textarea style="height:70px; width:90%;"  name="MetaDescription" class="noeditor"  
		id="MetaDescription"><?php echo $content["cMetaDescription"]; ?></textarea></td>
	</tr>
		
    <tr>
        <td colspan="2">&nbsp;</td>                       
    </tr>
</table>
</form>
<div id="propertydf" style="display:none">
<p><?echo $property?></p>
</div>
<script language="javascript" type="text/javascript">
function CheckForm(f)
{
	if(f.URL.value=="")
	{
		alert("please enter Url String");
		return false;
	}
	if(f.Name.value=="")
	{
		alert("please enter name");
		return false;
	}
	return AIM.submit(f,null,true);
}

function addTablePr(id)
{
	vltb=getId("propertydf").innerHTML;
	tinymce.EditorManager.activeEditor.execCommand('mceInsertContent',false,vltb);
}
</script>